<?php

	require_once('common/connectdb.php');

	$ConnectDB = new ConnectDB();
	$qNews = "SELECT * FROM tb_news";
	$rNews = $ConnectDB->run_query($qNews);

	if(mysql_num_rows($rNews)!=0)
	{	
		//echo"<newsList>";
		echo"<NEWSLIST>";
		while ($row = mysql_fetch_assoc($rNews))
		{
			echo "<NEWS>  
 				<ID>".$row["news_id"]."</ID>
				<TITLE>".$row["news_title"]."</TITLE>
				<DATE>".$row["news_date"]."</DATE>
			</NEWS>\n";
		}
		echo"</NEWSLIST>";	
	} 
	else 
	{
		echo "<code>1</code>";
	}
?>
